<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="admin/_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <!-- 响应式-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.2.4/dist/semantic.min.css">
    <link rel="stylesheet" href="../../static/css/me.css">
    <link rel="stylesheet" href="../../static/lib/editormd/css/editormd.min.css">
    <title>分类新增</title>
</head>
<body>
<!--导航-->
<nav th:replace="admin/_fragments :: menu(3)" >

</nav>
<div class="ui attached menu">
    <div class="ui right aligned container">
        <div class="menu right">
            <a th:href="@{/admin/tag/input}" class="item active">发布</a>
            <a th:href="@{/admin/tags}" class="item ">列表</a>
        </div>
    </div>
</div>
<!--中间部分-->
<div class="m-container m-container-small m-padded-tb-large">
    <div class="ui container">
        <form  method="post" th:object="${tag}" th:action="*{id == null} ? @{/admin/tags} : @{/admin/tags/{id}(id=*{id})}" class="ui form">
            <div class="required field">
                <div class="ui  labeled fluid input">
                    <label  class="ui teal basic label">名称</label>
                    <input  type="text" name="name" placeholder="分类名称" th:value="*{name}">
                </div>
            </div>

            <!--/*/<div class="ui negative message" th:if="${#fields.hasErrors('name')}">
                <i class="close icon"></i>
                <div class="header">验证失败</div>
                <p th:errors="*{name}">提交信息不符合规则</p>
            </div>/*/-->

            <div class="ui error message">

            </div>
            <div class="ui right aligned container">
                <button class="ui button" onclick="window.history.go(-1)">返回</button>
                <button type="submit"  class="ui teal button">提交</button>
            </div>
        </form>
    </div>
</div>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<!--尾部-->
<footer th:replace="admin/_fragments :: footer" ></footer>

<!--/*/<th:block th:replace="_fragments :: script">/*/-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
<!--</th:block>-->

<script>

    $('.menu.toggle').click(
        function () {
            $('.m-item').toggleClass('m-mobile-hide');
        }
    )
    $('.ui.dropdown').dropdown({
        on: 'hover'
    })
    $('.ui .form').form({
        fields: {
            title: {
                identifier: 'name',
                rules: [{
                    type: 'empty',
                    prompt: '分类内容不能为空'
                }

                ]
            }
        }
    })
    var testEditor;


</script>
</body>
</html>